package homeWork0825;

import java.util.List;
import java.util.Map;

public class Main {

    public static void main(String[] args) {
       String sql = "select b_id id,b_no no,b_name name from tbl_book_info where b_status = 1 and b_id = 1";
       List<Map<String,Object>> books = BookInFoDao.excuteQuery(sql);
       System.out.println(books);
//       String sql1 = "insert into tbl_book_info(b_no,b_name,b_price,b_status) values('02','数据库',123,1)";
//       Boolean res = BookInFoDao.excuteUpdate(sql1);
//       if(res){
//           System.out.println("添加成功");
//       }
       String sql2 = "update tbl_book_info set b_status = 0 where b_no = 02";
       if(BookInFoDao.excuteUpdate(sql2)){
           System.out.println("修改成功");
       }
       String sql3 = "delete from tbl_book_info where b_id = 3";
       if(BookInFoDao.excuteUpdate(sql3)){
           System.out.println("删除成功");
       }
       BookInFoDao.close();
    }
}
